package com.followmeandroid.models;

/**
 * <p>Title: SingleToken</p>
 * <p>Description: This class stores a single authentication
 * token for the currently logged in member.</p>
 * @author Adam Drews
 * @email adam.drews@my.uwrf.edu
 * @date 11/19/2014
 * @team Tyler Johnson
 * @email tyler.johnson@my.uwrf.edu
 * @team Nicholas Thorp
 * @email nicholas.thorp@my.uwrf.edu
 */
public class SingleToken {

    /**
     * Default constructor.
     */
    private SingleToken() {
    }

    /**
     * Returns the current token held by the current member.
     * @return aSingleToken.token       The member's current token.
     */
    public static synchronized Token getToken() {
        return aSingleToken.token;
    }

    /**
     * Sets the token of the current member.
     * @param in        The token to be used by the current member.
     */
    public static synchronized void setToken(Token in) {
        aSingleToken.token = in;
    }

    /**
     * A private nested class to store the a single current token of the current member.
     */
    private static class aSingleToken {
        private static Token token = null;
    }
}
